$('.travel-d-h-return').click(function(e){
    window.history.back(-1); 
    e.prevent();
})

//骨架屏
function skeleton(time){
    setTimeout(function(){
// $(".skeleton").removeClass("skeleton"); 
$(".skeleton").each(function(index,item){
    setTimeout(function(){
        $(item).removeClass("skeleton");
    },time)
    $(".skt-loading").removeClass("skt-loading")
    $(".mask").removeClass("mask");
})
},time) 
}

$(".detailed-nav").on("click",".nav-n",function(){
    let index =$(this).index();
    
    $(this).addClass("on").siblings().removeClass("on");
    $(".detailed").eq(index).show().siblings().not("ul").hide();
})

function getParam(){
   let C1=window.location.href.split("?")[1]; //得到id=12312312
        C1 = C1.split("&");
    let C2=C1[0].split("=")[1]; //得到id
    // let address = C1[1].split("=")[1]
    // console.log(address);
    // alert(C1); alert(C2)
    // $(".travel-d-h-return").attr("href",address+"?state=true");
    return C2;
}

function ChangeData(){
    let dataId = getParam();
    $.ajax({
        url:"https://www.fastmock.site/mock/0a7377ad1598acf1f7e8229f1793af9f/iTrip-G3/detailed",
        success:function(d){
            if(d.code==200){
                skeleton(500);  
                console.log(dataId);
              let data=d.data[0].goo;
              for(index in data){
                  if(data[index].goodsId==dataId){
                    //   console.log(data[index]);
                      $(".section-img img").attr("src",data[index].goodsImg);
                      $(".trvel-d-s-ed").html("编号："+data[index].goodsId);
                      $(".content-introduction-title").html(data[index].goodsTitle);
                      $(".price span").html(data[index].price);
                  }
              }
            }
        }
    })
}
ChangeData();